<template>
  <view class="content">
    <button type="primary" class="button" @click="navigateToHomePage">
      任务单操作(操作员&管理员)
    </button>
    <button type="primary" class="button">任务单处理(管理员)</button>
  </view>
</template>

<script>
import { getPermissionInfo } from "@/service/index";
import { RESPONSE_CODE, STORAGE_KEY } from "@/common/constant";


export default {
  data() {
    return {
      title: "Hello",
    };
  },
  onLoad() {
    this.getPermissionInfo();
  },
  methods: {
    getPermissionInfo() {
      getPermissionInfo().then((res) => {
        if (res.code == RESPONSE_CODE.SUCCESS) {
          console.log("用户权限信息成功", res);
          uni.setStorageSync(STORAGE_KEY.userInfo, res.data);
        } else {
          console.log("用户权限信息失败", res);
          uni.removeStorageSync(STORAGE_KEY.userInfo);
        }
      });
    },
    navigateToHomePage() {
      uni.navigateTo({
        url: "/pages/homePage/index",
      });
    },
  },
};
</script>

<style>
.button {
  width: 100%;
  margin-top: 70rpx;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70rpx;
}
</style>
